<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 
<!DOCTYPE HTML>
<html lang="zh-CN">
  <head>
 
    
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <title>个人认证</title>
    <%@ include file="../common/common.jsp"%>
    
  
  <body class="console-body">
  		    
            <jsp:include page="../common/console.jsp"></jsp:include>
  
  	<div class="console-list">
  		<div class="console-listSolid">&nbsp;</div>
  		<div class="approve-formContent">
  			<form action="" method="post">
  				<div class="approve-title">个人用户认证</div>
				<ul class="approve-contentBox">
					<li><span>手机号：</span>${userModel.phone}</li>
					<li><span>真实姓名：</span>${userModel.name}</li>
					<li><span>公司/个人工作室：</span>${userModel.company}</li>
					<li><span>办公地址：</span>${userModel.site}</li>
					<li><span>名片：</span><div class="approve-imgBox"><img src="<%=Property.getProperty("FILESERVER_PATH") %>?id=${userModel.license}"/></div></li>
					<li>
						<span>身份证正面：</span><div class="approve-imgBox"><img src="<%=Property.getProperty("FILESERVER_PATH") %>?id=${userModel.idfront}"/></div>
						<span class="ap-twoImg">身份证反面：</span><div class="approve-imgBox"><img src="<%=Property.getProperty("FILESERVER_PATH") %>?id=${userModel.idopposite}"/></div>
					</li>
					<li><span>个人主要作品：</span>${userModel.works1}；${userModel.works2}；${userModel.works3}</li>
				</ul>
				<c:if test="${param.task!='view'}">
						<ul class="approve-btnBar"> 
							<li><a class="btn approve-btn" href="after/user/approve_user_list" role="button">取消</a></li>
							<li><a id="ap-nopassBtn" class="btn approve-btn" href="javascript:;" role="button">认证不通过</a></li>
							<li><a class="btn approve-btn" href="javascript:authentication(${userModel.id},1,null);" role="button">认证通过</a></li>
						</ul>
				</c:if>
  			</form>
  		</div>
  	</div>
  	
	<!-- Modal -->
	<div class="modal fade bs-example-modal-sm" id="ap-nopassModal" tabindex="-1" role="dialog" aria-labelledby="ap-nopassModalLabel" data-backdrop="static">
	  <div class="modal-dialog modal-sm" role="document">
 
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title" id="myModalLabel">审核理由</h4>
		      </div>
		      
		      <div class="modal-body console-modalBody">
		        <textarea placeholder="不通过的理由..." cols="34" rows="5" id="reason"></textarea>
		      </div>
		    
			      <div class="modal-footer">
			        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			        <button type="button" class="btn btn1" onclick="authentication('${userModel.id}',2,$('#reason').val())">确定</button>
			      </div>
 
		    </div>
 
	  </div>
	</div>
	
	<script type="text/javascript">
		$(document).ready(function(){
			modalSwitch();
		});
		
		function modalSwitch(){
			$("#ap-nopassBtn").click(function(){
				$("#ap-nopassModal").modal('show');
			});
		}
		
		function authentication(id,authentication,reason){
		
			    	 $.ajax({
					     type: 'get',
					     url:  '<%=request.getContextPath() %>/after/user/updateAuthentication', 
						 data: {"reason":reason,"authentication":authentication,"id":id},
						 dataType: 'json',
						 success: function(data) {  
			                if(data.result){
			                
			                    jAlert(data.msg,'提示', function() {
								  window.location.href='<%=request.getContextPath() %>/after/user/approve_user_list';
								});
		 
			                  
			                }else{
			                	jAlert(data.msg,'提示');
			                }
		
			            }
						
					 });
		
		}
	</script>
	
  </body>
</html>
